
public class Value extends Node{
	
	boolean symbolicFlag = false;
	double value;
	int variableNumber;
	//never give this a variable number greater than or equal to
	//the number of variables you're going to pass it. We're not
	//checking bounds.
	public Value(boolean variable, double newValue, int varNum){
		order = 0;
		
		if(!variable){
			value = newValue;
		}else{
			symbolicFlag = true;
			variableNumber = varNum;
		}
	}
	
	@Override
	double evaluate(double[] vars) {
		if(!symbolicFlag){
			return value;
		}
		else{
			return vars[variableNumber];//TODO variable lookup
		}
	}
	
	Value deepCopy(){
		Value returner = new Value(symbolicFlag, value, variableNumber);
		return returner;
	}
	
	public String toString(){
		if(symbolicFlag){
			return ("["+(variableNumber)+"]");
		}else
			return (""+value);
	}

}
